
Function.prototype.bind2 = function(context, ...args) {
    let self = this;
    let fn = function() {
        return self.apply(context, args);
    }
    fn.prototype = this.prototype;
    return fn;
}
let b = 2;
function a () {
    console.log(this)
    console.log(this.b);
}
let c = a.bind2({b: 1});
c();
a();